<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>报关单登记系统</title>
<!--#include file="lib/plugins.asp"-->
<style type="text/css">
	.ui-datepicker table {
		border: 0;
	}
	#tablelist{
		min-width:30%;
	}
</style>
<script type="text/javascript">
	$(function() {
	});
</script>	
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<%
if not CheckPostFlag(session("aaPostFlag"),0,15) then call JumpErrorPage(2)
id=request("id")
submit=request("submit")
if id<>"" then
	sql = "select * from tmp where id="&id
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open sql,conn,1,1
	if not rs.eof then
		receive=rs("receive")
		pay=rs("pay")
	end if
	rs.close
	set rs=nothing
end if
if submit<>"" then
	receive=request("receive")
	pay=request("pay")
	if submit="新增" then	sql="insert into tmp(receive,pay) values("&receive&","&pay&")"
	if submit="保存" then	sql="update tmp set receive="&receive&",pay="&pay&" where id="&id
	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection = conn
	cmd.CommandText = sql
	cmd.Execute
end if
%>

<body>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">
<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
	<div id="col3" role="main">
		<div id="col3_content" class="clearfix">
			<form name="form1" method="post" class="yform columnar" role="application">
				<fieldset>
					<legend>报关费模板</legend>
					<div class="subcolumns">
						<div class="c50l">
							<div class="type-text">
								<label for="receive">应收*</label>
								<input name="receive" id="receive" type="text" size="10"  value="<%if submit="新增" then response.write("") else response.write(receive)%>" />
							</div>
						</div>
						<div class="c50r">
							<div class="type-text">
								<label for="pay">应付*</label>
								<input name="pay" id="pay" type="text" size="10"  value="<%if submit="新增" then response.write("") else response.write(pay)%>" />
							</div>
						</div>
					</div>
				</fieldset>
				<div class="type-button">
				<%
					if id<>"" then
				%>
					<input type="submit" name="submit" class="submit" value="保存" />
				<%
					else
				%>
					<input type="submit" name="submit" class="submit" value="新增" />
				<%
					end if
				%>
				</div>
			</form>
			<table id="tablelist">
				<thead>
					<tr><th colspan="3" scope="col">报关费模板明细</th></tr>
				</thead>
				<tbody>
					<tr>
						<th scope="col">ID</th>
						<th scope="col">应收</th>
						<th scope="col">应付</th>
					</tr>
					<%
						sql = "select * from tmp"
						Set rs = Server.CreateObject("ADODB.Recordset")
						rs.Open sql,conn,1,1
						do while not rs.eof
					%>
					<tr>
						<th class="sub" scope="row"><a href="tmp.asp?id=<%=rs("id")%>"><%=rs("id")%></a></th>
						<td><%=rs("receive")%></td>
						<td><%=rs("pay")%></td>
					</tr>
					<%
						
							rs.movenext
						loop
						rs.close
						set rs=nothing
					
					%>
					
				</tbody>
			</table>
		</div>
	</div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<!--#include file="lib/connclose.asp"-->

